package com.qs.security.config;

import com.qs.security.utils.RsaUtils;
import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

import java.security.PublicKey;

@Data
@ConfigurationProperties(prefix = "rsa.key")
public class RsaKeyProperties {

    private String pubKeyFile;

    private PublicKey publicKey;

    public void loadKey() throws Exception {
        RsaUtils.getPrivateKey(pubKeyFile);
    }
}
